import { EDIT_PASSWORD, LOG_OUT, } from '../constants/ActionTypes'


const initialState = {
    editPasswordStatus: false,
    logOutStatus:false,
}


const userReducer = (state = initialState, action) =>{ 
    switch (action.type){
        case EDIT_PASSWORD:             
            return Object.assign({},state,{
                editPasswordStatus:!state.editPasswordStatus
            });   
        case LOG_OUT:   
            //退出登录成功，删除session中的用户信息
            // sessionStorage.clear();                      
            return Object.assign({},state,{
                logOutStatus:!state.logOutStatus
            });                                     
        default:
            return {...state}
   }
}

export const editPasswordStatus = (state) => state.editPasswordStatus

export const logOutStatus = (state) => state.logOutStatus



export default userReducer
